package com.cjz.rxjavalearn;

import android.app.Application;

import com.cjz.rxjavalearn.api.API;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by cjz on 2016/11/28.
 */

public class RetrofitDemoApp extends Application {

    static RetrofitDemoApp app;

    public RetrofitDemoApp() {
        app = this;
    }

    static public RetrofitDemoApp getApp() {
        return app;
    }


    public Retrofit getRetrofit() {
        return retrofit;
    }

    Retrofit retrofit;

    @Override
    public void onCreate() {
        super.onCreate();

        retrofit = new Retrofit.Builder()
                .baseUrl(API.baseUrl)
                .addConverterFactory(GsonConverterFactory.create())
                .build();

    }
}
